package com.zlsy.learning.leetcode.arraycorrelation.array1295;

/**
 * @author zhouliang
 * @date 2020/6/5 17:50
 */
public class FindNumbers {

    /**
     * 执行用时 :
     * 10 ms, 在所有 Java 提交中击败了10.77%的用户
     *
     * @param nums int[] nums = new int[]{12, 345, 2, 6, 7896};
     * @return count
     */
    public static int findNumbers(int[] nums) {
        //变量一个数组，长度是偶数为就加一
        int count = 0;
        for (int num : nums) {
            if (((num + "").length() & 1) == 0) {
                count++;
            }
        }
        return count;
    }

    public static void main(String[] args) {
        int[] nums = new int[]{12, 345, 2, 6, 7896};
        int numbers = findNumbers(nums);
        System.out.println(numbers);
    }
}
